﻿namespace SpaceshipDuelConfig
{
    using System;
    using System.Collections.Generic;
    using System.Text;

    /// <summary>
    /// Serializable class containing all configuration data
    /// </summary>
    [Serializable]
    public class ConfigData
    {
        #region Private fields

        private int resolutionWidth;        // Bildschirmauflösung Breite in Pixel
        private int resolutionHeight;       // Bildschirmauflösung Höhe in Pixel
        private bool fullscreenMode;        // Vollbildschirm- oder Fenstermodus
        private int volumeMusic;            // Lautstärke Musik
        private int volumeSfx;              // Lautstärke Soundeffekte
        private string player1KeyUp;        // Steuerung Spieler 1 Taste Vorwärts
        private string player1KeyDown;      // Steuerung Spieler 1 Taste Rückwärts
        private string player1KeyLeft;      // Steuerung Spieler 1 Taste Links drehen
        private string player1KeyRight;     // Steuerung Spieler 1 Taste Rechts drehen
        private string player1KeyFire;      // Steuerung Spieler 1 Taste Feuern
        private string player1KeySpecial;   // Steuerung Spieler 1 Taste Spezialwaffe auslösen
        private string player2KeyUp;        // Steuerung Spieler 2 Taste Vorwärts
        private string player2KeyDown;      // Steuerung Spieler 2 Taste Rückwärts
        private string player2KeyLeft;      // Steuerung Spieler 2 Taste Links drehen
        private string player2KeyRight;     // Steuerung Spieler 2 Taste Rechts drehen
        private string player2KeyFire;      // Steuerung Spieler 2 Taste Feuern
        private string player2KeySpecial;   // Steuerung Spieler 2 Taste Spezialwaffe auslösen
        private int particles;              // Stärke/Anzahl der Partikeleffekte
        private bool fps;                   // Anzeige Frames per Second
        private int worldSize;              // Größe des Spielfeldes
        private int asteroids;              // Anzahl der Asteroiden
        private int enemies;                // Anzahl der Gegner
        private int lives;                  // Anzahl der Leben pro Spieler
        private string language;            // Sprache

        #endregion Private fields

        #region Construction

        public ConfigData(int resWidth, int resHeight, bool fullScreen, int volumeMusic, int volumeSfx,
                          string p1Up, string p1Down, string p1Left, string p1Right, string p1Fire, string p1Special,
                          string p2Up, string p2Down, string p2Left, string p2Right, string p2Fire, string p2Special,
                          int particles, bool showFps, int worldSize, int asteroids, int enemies, int lives, string language)
        {
            resolutionWidth     = resWidth;
            resolutionHeight    = resHeight;
            fullscreenMode      = fullScreen;
            this.volumeMusic    = volumeMusic;
            this.volumeSfx      = volumeSfx;
            player1KeyUp        = p1Up;
            player1KeyDown      = p1Down;
            player1KeyLeft      = p1Left;
            player1KeyRight     = p1Right;
            player1KeyFire      = p1Fire;
            player1KeySpecial   = p1Special;
            player2KeyUp        = p2Up;
            player2KeyDown      = p2Down;
            player2KeyLeft      = p2Left;
            player2KeyRight     = p2Right;
            player2KeyFire      = p2Fire;
            player2KeySpecial   = p2Special;
            this.particles      = particles;
            fps                 = showFps;
            this.worldSize      = worldSize;
            this.asteroids      = asteroids;
            this.enemies        = enemies;
            this.lives          = lives;
            this.language       = language;
        }

        private ConfigData()
        {
        }

        #endregion Construction

        #region Public members

        public int ResolutionWidth
        {
            get { return this.resolutionWidth; }
            set { this.resolutionWidth = value; }
        }

        public int ResolutionHeight
        {
            get { return this.resolutionHeight; }
            set { this.resolutionHeight = value;}
        }

        public bool FullscreenMode
        {
            get { return this.fullscreenMode; }
            set { this.fullscreenMode = value; }
        }

        public int VolumeMusic
        {
            get { return this.volumeMusic; }
            set { this.volumeMusic = value; }
        }

        public int VolumeSfx
        {
            get { return this.volumeSfx; }
            set { this.volumeSfx = value; }
        }

        public string Player1KeyUp
        {
            get { return this.player1KeyUp; }
            set { this.player1KeyUp = value; }
        }

        public string Player1KeyDown
        {
            get { return this.player1KeyDown; }
            set { this.player1KeyDown = value; }
        }

        public string Player1KeyLeft
        {
            get { return this.player1KeyLeft; }
            set { this.player1KeyLeft = value; }
        }

        public string Player1KeyRight
        {
            get { return this.player1KeyRight; }
            set { this.player1KeyRight = value; }
        }

        public string Player1KeyFire
        {
            get { return this.player1KeyFire; }
            set { this.player1KeyFire = value; }
        }

        public string Player1KeySpecial
        {
            get { return this.player1KeySpecial; }
            set { this.player1KeySpecial = value; }
        }

        public string Player2KeyUp
        {
            get { return this.player2KeyUp; }
            set { this.player2KeyUp = value; }
        }

        public string Player2KeyDown
        {
            get { return this.player2KeyDown; }
            set { this.player2KeyDown = value; }
        }

        public string Player2KeyLeft
        {
            get { return this.player2KeyLeft; }
            set { this.player2KeyLeft = value; }
        }

        public string Player2KeyRight
        {
            get { return this.player2KeyRight; }
            set { this.player2KeyRight = value; }
        }

        public string Player2KeyFire
        {
            get { return this.player2KeyFire; }
            set { this.player2KeyFire = value; }
        }

        public string Player2KeySpecial
        {
            get { return this.player2KeySpecial; }
            set { this.player2KeySpecial = value; }
        }

        public int Particles
        {
            get { return this.particles; }
            set { this.particles = value; }
        }

        public bool FPS
        {
            get { return this.fps; }
            set { this.fps = value; }
        }

        public int WorldSize
        {
            get { return this.worldSize; }
            set { this.worldSize = value; }
        }

        public int Asteroids
        {
            get { return this.asteroids; }
            set { this.asteroids = value; }
        }

        public int Enemies
        {
            get { return this.enemies; }
            set { this.enemies = value; }
        }

        public int Lives
        {
            get { return this.lives; }
            set { this.lives = value; }
        }

        public string Language
        {
            get { return this.language; }
            set { this.language = value; }
        }

        #endregion Public members
    }
}
